﻿@model IEnumerable<ToWaTimeReportMVC4.Models.JobView>
@{
    ToWaTimeReportMVC4.Models.ToWaService service = new ToWaTimeReportMVC4.Models.ToWaService();
    ToWaTimeReportMVC4.Models.User user = service.GetUserByUsername(User.Identity.Name);
    if (user != null)
    {
        if (user.Type == 0 || user.Type == 2)
        {

            ViewBag.Title = "Index";


<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Description)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.StartTime)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.EndTime)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ProjectName)
        </th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.StartTime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.EndTime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ProjectName)
        </td>
    </tr>
}

<tr>
    <td>
        @Html.ActionLink("Weakly Rapport", "Rapport", new { normal = 40 })
    </td>
</tr>

</table>
        }
        else
        {
            <p>Permission denied!</p>
        }
    }
}